﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DataTables
{
    public partial class Main : Form
    {
        public Main()
        {
            InitializeComponent();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("colums0");
            for (int i = 1; i < 5; i++)
            {
                DataColumn dc = new DataColumn(string.Format("colums{0}",i));
                dt.Columns.Add(dc);
            }
            dataGridView1.DataSource = dt;
        }


    }
}
